<template>
  <div class="table_caozuo">
    <template v-for="(item,index) in btn">
      <a-button
        :key="index"
        @click="handler(index)"
        v-if="item.isShow"
        type="primary"
        style="margin:0 10px 20px 0"
      >{{item.title}}</a-button>
    </template>
    <a-table
      rowKey="id"
      :columns="tableOption"
      :dataSource="loadData"
      :pagination="pagination"
      :loading="loading"
      bordered
    >
      <span slot="action">
        <template>
          <a-button type="link" @click="kucunLs()">查看明细</a-button>
        </template>
      </span>
    </a-table>
    <a-modal title="查看明细" v-model="dialogVisible" width="50%">
      <template>
        <a-button @click="daochuMingxi()" type="primary" style="margin:0 10px 20px 0">导出</a-button>
      </template>
      <a-tabs type="card" @change="callback">
        <a-tab-pane key="1" tab="配送单" :forceRender="true">
          <a-table
            rowKey="id"
            :columns="tableOption1"
            :dataSource="loadData1"
            :pagination="false"
            :loading="loading1"
          ></a-table>
        </a-tab-pane>
        <a-tab-pane key="2" tab="采购退货" :forceRender="true">
          <a-table
            rowKey="id"
            :columns="tableOption2"
            :dataSource="loadData2"
            :pagination="false"
            :loading="loading2"
          ></a-table>
        </a-tab-pane>
      </a-tabs>
    </a-modal>
  </div>
</template>

<script src='./list_table.js'></script>

<style lang="less">
.table_caozuo {
  margin: 10px 0px;
}
</style>